<template>
	<uni-popup ref="AppraisePopup" height="400rpx" width="400rpx" type="center" :animation="false">
		<view class="mypopup" @click="clickMyPopup">
			<view class="mypopup__head">
				<text>微信评价二维码</text>
			</view>
			<view class="mypopup__body" style=" display: flex;flex-direction: row;align-items: center; justify-content: center;"> 
				<tkiQrcode :val="qrval" :size="qrsize" ref="qrcode"></tkiQrcode>
			</view>
			<view class="mypopup__head">
				<text>扫二维码评价</text>
			</view>
		</view>
	</uni-popup>
</template>

<script>
	import tkiQrcode from 'tki-qrcode/components/tki-qrcode/tki-qrcode.vue'
	import uniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup';
	export default {
		components: {
			uniPopup,
			tkiQrcode
		},
		props: {
			qrval: {
				type: String,
				default () {
					return ""
				}
			},
			qrsize: {
				type: Number,
				default () {
					return 240
				}
			}
		},
		watch: {
			qrval: {
				handler(newval, oldval) {
					if (newval && newval != oldval){
						this.$refs.qrcode._makeCode();
						
					}
				}
			}
		},
		mounted() {

		},
		methods: {
			clickMyPopup(){
				this.$refs.AppraisePopup.close();
			},
			openPoPup() {
				this.$refs.AppraisePopup.open();
				
			},
			closePoPup() {
				this.$refs.AppraisePopup.close();

			},
		}
	}
</script>

<style>
</style>
